/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.asportoonline.various;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author fe
 */
public class LocaleValidation {

    public static boolean regexpr(String patt, String arg) {
        Pattern p = Pattern.compile(patt);
        Matcher m = p.matcher(arg);
        return m.matches();
    }
    
    public static boolean validateEmail(String mail) {
        return regexpr("^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$", mail);
    }
    
    public static boolean validatePiva(String piva) {
        return regexpr("^[0-9]{11,}$", piva);
    }
    

}
